package com.ruoyi.project.system.strategy.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.strategy.mapper.TbDiyStrategyMapper;
import com.ruoyi.project.system.strategy.domain.TbDiyStrategy;
import com.ruoyi.project.system.strategy.service.ITbDiyStrategyService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 策略生成Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-28
 */
@Service
public class TbDiyStrategyServiceImpl implements ITbDiyStrategyService 
{
    @Autowired
    private TbDiyStrategyMapper tbDiyStrategyMapper;

    /**
     * 查询策略生成
     * 
     * @param strategyNm 策略生成主键
     * @return 策略生成
     */
    @Override
    public TbDiyStrategy selectTbDiyStrategyByStrategyNm(String strategyNm)
    {
        return tbDiyStrategyMapper.selectTbDiyStrategyByStrategyNm(strategyNm);
    }

    /**
     * 查询策略生成列表
     * 
     * @param tbDiyStrategy 策略生成
     * @return 策略生成
     */
    @Override
    public List<TbDiyStrategy> selectTbDiyStrategyList(TbDiyStrategy tbDiyStrategy)
    {
        return tbDiyStrategyMapper.selectTbDiyStrategyList(tbDiyStrategy);
    }

    /**
     * 新增策略生成
     * 
     * @param tbDiyStrategy 策略生成
     * @return 结果
     */
    @Override
    public int insertTbDiyStrategy(TbDiyStrategy tbDiyStrategy)
    {
        return tbDiyStrategyMapper.insertTbDiyStrategy(tbDiyStrategy);
    }

    /**
     * 修改策略生成
     * 
     * @param tbDiyStrategy 策略生成
     * @return 结果
     */
    @Override
    public int updateTbDiyStrategy(TbDiyStrategy tbDiyStrategy)
    {
        return tbDiyStrategyMapper.updateTbDiyStrategy(tbDiyStrategy);
    }

    /**
     * 批量删除策略生成
     * 
     * @param strategyNms 需要删除的策略生成主键
     * @return 结果
     */
    @Override
    public int deleteTbDiyStrategyByStrategyNms(String strategyNms)
    {
        return tbDiyStrategyMapper.deleteTbDiyStrategyByStrategyNms(Convert.toStrArray(strategyNms));
    }

    /**
     * 删除策略生成信息
     * 
     * @param strategyNm 策略生成主键
     * @return 结果
     */
    @Override
    public int deleteTbDiyStrategyByStrategyNm(String strategyNm)
    {
        return tbDiyStrategyMapper.deleteTbDiyStrategyByStrategyNm(strategyNm);
    }
}
